<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var fruit = prompt('请输入想要查询的水果'); //弹窗提示用户输入
        switch (fruit){
            case'西瓜'://情况1值的
            console.log('西瓜2块钱一斤')
            alert('西瓜好吃 两块钱一斤')
            break;
            case'香蕉':
            console.log('香蕉2块82一斤')
            break;
            case'火龙果':
            console.log('火龙果3块钱一斤')
            break;
            case'桃子':
            console.log('桃子1块钱一斤')
            break;
            default:
                console.log('店里没有这个水果');
        }

    </script>
</body>
</html>